package com.stage_2.module_1;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class DBCPTest {

    public static void main(String[] args) throws Exception {

        Connection con = DBUtils.getConnection();

        Statement statement = con.createStatement();

        String sql = "select name from employee";
        ResultSet resultSet = statement.executeQuery(sql);

        while(resultSet.next()){
            String ename = resultSet.getString("name");
            System.out.println("员工姓名: " + ename);
        }

        DBUtils.close(con, statement, resultSet);
    }

}
